package com.design.mall.impl;

import com.design.mall.CashRegister;

/**
 * 打折收费策略
 * @author by liuxin
 * @version 0.1
 */
public class CashDiscount extends CashRegister {

    /**
     * 折扣
     */
    private final double discount;

    public CashDiscount(double discount) {
        this.discount = discount;
    }

    @Override
    public double acceptCash(double money) {
        return money * discount;
    }
}
